package com.nineclock.sign.mapper;

import com.nineclock.sign.dto.SignsDTO;
import com.nineclock.sign.pojo.SignInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.nineclock.sign.pojo.SignInfo
 */
public interface SignInfoMapper extends BaseMapper<SignInfo> {

    @Select("SELECT COUNT(*) AS sign_count,create_date AS sign_date FROM `sign_info` WHERE create_date BETWEEN #{startTime} AND #{endTime} AND company_user_id =#{id} GROUP BY company_user_id,create_date;")
    List<SignsDTO> countByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("id") Long id);
}




